package com.walter.model.vo;

import cn.hutool.core.bean.BeanUtil;
import com.walter.Application;
import com.walter.entity.Role;
import com.walter.entity.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author ：ch
 * @date ：Created in 2021/5/25
 * @description：
 * @modified By：
 * @version: 1.0
 */
@Data
@Accessors(chain = true)
public class UserVODetail extends UserVO{
    private List<MenuVO> menuVOList;

    private List<Role> roleList;

    @ApiModelProperty("用于前端动态路由")
    private List<String> menuPaths;

    public UserVODetail(User user){
        if (null != user){
            BeanUtil.copyProperties(user,this);
            this.setGenderName(Application.secondLevelDictMap.getStr(this.getGender()));// todo
        }
    }
}
